package ioperations;

import book.BookList;

import java.util.Scanner;

public class BorrowOPeration implements IOPeration{
    public void walk(BookList booklists){
        System.out.println("请输入你要借出的书的名字:");
        Scanner scanner=new Scanner(System.in);
        String name=scanner.nextLine();
        for (int i=0;i<booklists.getUsedSize();i++){
            if((booklists.books[i].name).equals(name)&&(booklists.books[i].zt==false)){
                System.out.println("借阅成功!!");
                booklists.books[i].zt=true;
                return;
            }
        }
        System.out.println("该书已被借出，无法借阅该书!!");
    }
}
